package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.CategorySubTypeDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.CategorySubTypeManager;
import com.hanoiwiki.model.CategorySubType;

@Component
@Transactional
public class CategorySubTypeManagerImpl extends BaseManagerImpl implements CategorySubTypeManager{

	@Autowired
	private CategorySubTypeDAO categorySubTypeDAO;
	
	@Override
	public void save(CategorySubType categorySubType) {
		try {
			categorySubTypeDAO.save(categorySubType);
		} catch (DataAccessException e) {			
			log.error("", e);
		}		
	}

	@Override
	public void update(CategorySubType categorySubType) {
		try {
			categorySubTypeDAO.update(categorySubType);
		} catch (DataAccessException e) {			
			log.error("", e);
		}
	}

	@Override
	public CategorySubType get(Integer id) {
		try {
			return categorySubTypeDAO.get(id);
		} catch (DataAccessException e) {			
			log.error("", e);
		}
		return null;
	}

	@Override
	public List<CategorySubType> getList() {
		try {
			return categorySubTypeDAO.getList();
		} catch (DataAccessException e) {			
			log.error("", e);
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			categorySubTypeDAO.remove(id);
		} catch (DataAccessException e) {			
			log.error("", e);
		}
	}

}
